package model;

import java.io.Serializable;

/**
 * Klasse Message
 * 
 * @author Magnus Brieler
 */

public class Message implements Serializable {

	// Attribute
	private MessageType type;
	private String content;
	private User from;
	private Moment time;

	// Konstruktoren
	public Message() {
		content = "";
		from = new User();
		time = new Moment();
		type = MessageType.STANDARD;
	}

	public Message(String content, User from, Moment time) {
		this.content = content;
		this.from = from;
		this.time = time;
		type = MessageType.STANDARD;
	}

	public Message(String content, User from, Moment time, MessageType type) {
		this.content = content;
		this.from = from;
		this.time = time;
		this.type = type;
	}


	// Getter
	public MessageType getType() {
		return type;
	}
	
	public String getContent() {
		return content;
	}

	public User getFrom() {
		return from;
	}

	public Moment getTime() {
		return time;
	}

	// Setter
	public void setType(MessageType type) {
		this.type = type;
	}
	
	public void setContent(String content) {
		this.content = content;
	}

	public void setFrom(User from) {
		this.from = from;
	}

	public void setTime(Moment time) {
		this.time = time;
	}

	// Methoden
	
	
	//enums
	public enum MessageType {
		STANDARD(), SYSTEM(), WARNING();
	}
	
}